from flask import Blueprint, session, render_template, flash, send_from_directory, url_for, request

from core.blueprints.edit.personal.form import PersonalForm, ProveForm, is_personal, is_prove
from core.url.page import url_for_aside

personal_blueprint = Blueprint('personal', __name__)

@personal_blueprint.route('/personal', methods=['GET', 'POST'])
def personal():
    uid = session.get('uid')
    form1 = PersonalForm()
    form2 = ProveForm()

    # if request.method == 'POST':
    #     if is_personal(form1):
    #         if submit_personal(form1, uid):
    #             flash('更新个人信息成功')
    #         else:
    #             flash('更新个人信息失败')
    #
    #     if is_prove(form2):
    #         if submit_prove(form2, uid):
    #             flash('上传身份证明成功')
    #         else:
    #             flash('上传身份证明失败')

    return render_template('pages/edit/personal.html', form1=form1, form2=form2,urls=url_for_aside(),intro=Intro_uid(uid))